﻿using System;
using System.Drawing;
using BlueDot.Mobile.Core;
using NavigationSample.UI;

namespace NavigationSample.Workflows
{
    public class FullViewWorkflow : ViewWorkflow
    {
        #region Events

        [Sender("action://FullView/previousButton/Click")]
        public event EventHandler MoveToPrevWorkflow;

        #endregion

        #region Constructors

        public FullViewWorkflow()
        {
            InitializeComponent();
        }

        [DependencyConstructor]
        public FullViewWorkflow(IMobileApplication application)
            : base(application)
        {
            InitializeComponent();
        }

        #endregion

        #region public

        [Receiver("action://FullView/previousButton/Click")]
        public void FullViewPrevious(object sender, EventArgs args)
        {
            if (MoveToPrevWorkflow != null)
            {
                MoveToPrevWorkflow(this, EventArgs.Empty);
            }
        }

        #endregion

        #region private

        private void InitializeComponent()
        {
            // 
            // Workflow
            // 
            this.SetDesignerItemLocation(typeof(BlueDot.Mobile.Core.Start), new System.Drawing.Point(479, 10));
            this.AssociateWorkflowItem(typeof(BlueDot.Mobile.Core.Start), typeof(NavigationSample.UI.FullView), "");
            this.SetDesignerItemLocation(typeof(NavigationSample.UI.FullView), new System.Drawing.Point(278, 107));
            // 
            // Actions
            // 
            this.ActionSenders.Add(new BlueDot.Mobile.Core.MetaActionSender(this, "MoveToPrevWorkflow", this, "", "action://FullViewWorkflow/MoveToPrevWorkflow"));
            this.RegisterActionSenders();

        }

        #endregion
    }
}